from base import Yaml, Path
from page.login.login import Login


class HomePage(Login):
    """首页"""
    __config = Yaml.get_config_as_dict(Path.get_actual_path_by_current_file(__file__, "login.yaml"))["HomePage"]

    def enter_the_login_page(self):
        """
        进入登录
        :param seconds:
        :return:
        """
        self._driver.click(self.__config["LOGIN_LOCATION"])

    def enter_the_registration_page(self):
        """
        进入注册
        :param seconds:
        :return:
        """
        self._driver.click(self.__config["REGISTERED_LOCATION"])

    def enter_the_order_page(self):
        """
        进入立即下单
        :param seconds:
        :return:
        """
        self._driver.click(self.__config["ORDERS_LOCATION"])

    def enter_aging_page(self):
        """
        进入时效查询
        :param seconds:
        :return:
        """
        self._driver.click(self.__config["AGING_QUERY"])

    def enter_the_website_query_page(self):
        """
        进入网点查询
        :param seconds:
        :return:
        """
        self._driver.click(self.__config["NETWORK_QUERY"])

    def enter_pick_up_position(self):
        """
        进入取货定位
        :param :
        :return:
        """
        self._driver.click(self.__config["PICKUP_LOCATION"])

    def waybill_tracking(self, orders):
        """
        运单搜索
        :param orders: 运单号
        :return:
        """
        self._driver.type(self.__config["WAYBILL_TRACKING_INPUT_BOX"], orders)
        self._driver.click(self.__config["SEARCH_BUTTON"])

    def Enter_more_products(self):
        """
        进入更多产品
        :param :
        :return:
        """
        self._driver.click(self.__config["MORE_GOODS"])
